<template>
  <div>
    <el-badge :value="count" class="item">
      <el-button size="small">在线人数</el-button>
    </el-badge>
    <el-table
      :data="item"
      border
      style="width: 100%">
      <el-table-column
        prop="date"
        label="日期"
        width="180">
      </el-table-column>
      <el-table-column
        prop="username"
        label="登录用户"
        width="180">
      </el-table-column>
      <el-table-column
        prop="ip"
        label="IP">
      </el-table-column>
    </el-table>
  </div>

</template>

<script>
  export default {
    data() {
      return {
        item:[],
        count:""
      }
    },
   mounted:function () {
     this.loadData();
   },
    methods:{

      loadData(){

        var _this = this;
        this.getRequest("/online/current/getCurrentOnline").then(resp=> {
          if (resp && resp.status == 200) {
            _this.item = resp.data.list;
            _this.count=resp.data.count;
          }
        })
      }
      }

  }
</script>
